package com.ztgf.order.mapper;

import com.baomidou.mybatisplus.plugins.Page;
import com.ztgf.order.models.bo.OrderGMVStatisticsBO;
import com.ztgf.order.models.bo.OrderShopStatisticsBO;
import com.ztgf.order.models.bo.OrderStatisticsBO;
import com.ztgf.order.models.vo.OrderGMVStatisticsVO;
import com.ztgf.order.models.vo.OrderSalesCategoryNewVO;
import com.ztgf.order.models.vo.OrderSalesCategoryShopVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/*
 * @author: chenyu.wang
 * @date: 2020-08-10
 * @description:后台管理系统GMV统计映射
 */
@Mapper
public interface OrderGMVStatisticsMapper {

    /*
     * @description:GMV统计今日订单总金额
     * @author: chenyu.wang
     * @date: 2020-08-10
     * @param:
     * @return:
     */
    BigDecimal queryGMVToDayOrderAmount();

    /*
     * @description:GMV各状态订单统计
     * @author: chenyu.wang
     * @date: 2020-08-10
     * @param:
     * @return:
     */
    OrderGMVStatisticsVO queryOrderStateAmount(@Param("item") OrderGMVStatisticsBO bo);

    /**
     * @Description: 新的各订单状态销售额统计
     * @Author: chenyu.wang
     * @Params: [orderState, bo]
     * @Date: 2020.12.13 15:16
     */
    BigDecimal getOrderStateAmount(@Param("orderState") Integer orderState, @Param("item") OrderGMVStatisticsBO bo);

    /**
     * @Description: 获取订单总金额
     * @Author: chenyu.wang
     * @Params: []
     * @Date: 2020.12.13 15:33
     */
    BigDecimal getTotalAmountOfOrders(@Param("item") OrderGMVStatisticsBO bo);

    /**
     * description:各类目整体销售额统计
     * param: [categoryId, bo]
     * author: chenyu.wang
     * date: 2020-07-22
     * return: java.math.BigDecimal
     */
    BigDecimal queryOrderSalesCategory(@Param("categoryId") Long categoryId, @Param("item") OrderStatisticsBO bo);

    /**
     * @Description:
     * @Author: chenyu.wang
     * @Params: [shopId, categoryId, bo]
     * @Date: 2020.12.13 15:42
     */
    BigDecimal queryOrderSalesShopItems(@Param("shopId") Long shopId, @Param("categoryId") Long categoryId, @Param("item") OrderShopStatisticsBO bo);

    /**
     * @Description: 新的各类目gmv统计，有订单的类目才显示
     * @Author: chenyu.wang
     * @Params: [page, bo]
     * @Date: 2020.12.27 22:39
     */
    List<OrderSalesCategoryNewVO> queryNewGmvOrderCount(Page<OrderSalesCategoryNewVO> page, @Param("item") OrderStatisticsBO bo);

    List<OrderSalesCategoryShopVO> queryOrderMoney(@Param("item")OrderShopStatisticsBO bo);
}
